package com.demoku.web.domain.test;

import java.io.Serializable;

import org.iff.infra.util.mybatis.service.Dao;

@SuppressWarnings("serial")
public class User implements Serializable {

	private String id;
	private String sex;
	private java.sql.Timestamp insertTime;
	private String description;
	private String name;

	public User() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	
	public java.sql.Timestamp getInsertTime() {
		return insertTime;
	}

	public void setInsertTime(java.sql.Timestamp insertTime) {
		this.insertTime = insertTime;
	}
	
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	

	public static User get(String id) {
		return Dao.queryOne("User_Mapping.getUser", id);
	}

	public static void remove(String id) {
		Dao.remove("User_Mapping.deleteUser", id);
	}

	public void save() {
		if (getId() == null) {
			Dao.save("User_Mapping.insertUser", this);
		} else {
			Dao.save("User_Mapping.updateUser", this);
		}
	}

	public void remove() {
		Dao.remove("User_Mapping.deleteUser", getId());
	}
}
